package work03;

import java.io.*;
import java.util.Properties;

public class work_ {
    public static void main(String[] args) throws IOException {
        Properties properties=new Properties();
        properties.setProperty("name","Tom" );
        properties.setProperty("age","5");
        properties.setProperty("color","red");
        properties.store(new FileWriter("src\\scratch.txt"),null);
        String pathname="d:\\dog.dat";
        ObjectOutputStream objectOutputStream=new ObjectOutputStream(new FileOutputStream(pathname));
        objectOutputStream.close();
    }
}
    class Dog implements Serializable{
        private String name;
        private int age;
        private String color;

        public Dog(String name,int age, String color) {
            this.name = name;
            this.age = age;
            this.color = color;
        }
        public String getName() {
            return name;
        }

        public int getAge() {
            return age;
        }

        public String getColor() {
            return color;
        }

        @Override
        public String toString() {
            return "Dog{" +
                    "name='" + name + '\'' +
                    ", age='" + age + '\'' +
                    ", color='" + color + '\'' +
                    '}';
        }
    }
